﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Quark.Profiler.Framework
{
    /// <summary>
    /// 测试服务端接口
    /// </summary>
    public interface IQuarkProfilerServer
    {
        /// <summary>
        /// 获取当前服务端的界面控制台接口
        /// </summary>
        IQuarkProfilerServerConsole Console { get; }
        /// <summary>
        /// 初始化当前服务端
        /// </summary>
        /// <param name="console">服务端界面控制台接口</param>
        void InitializeProfilerServer(IQuarkProfilerServerConsole console);
        /// <summary>
        /// 启动当前服务端
        /// </summary>
        void StartProfilerServer();
        /// <summary>
        /// 停止运行当前服务端
        /// </summary>
        void StopProfilerServer();
        /// <summary>
        /// 获取指定ID的测试项目
        /// </summary>
        /// <param name="projectId">测试项目ID</param>
        /// <returns>测试项目</returns>
        ProfilingTestProject GetProfilingTestProject(string projectId);
        /// <summary>
        /// 获取所有测试项目
        /// </summary>
        /// <returns>测试项目列表</returns>
        ProfilingTestProject[] GetAllProfilingTestProjects();
        /// <summary>
        /// 获取所有被运行的测试项目
        /// </summary>
        /// <returns>被运行的测试项目数组</returns>
        ProfilingTestProject[] GetAllStartedProfilingTestProjects();
        /// <summary>
        /// 获取对应指定测试项目的测试上下文实例
        /// </summary>
        /// <param name="project">项目</param>
        /// <returns>对应该测试项目实例的上下文实例</returns>
        IProfilingContext GetProfilingContext(ProfilingTestProject project);
    }
}
